package com.work;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by zhanghf on 2015/6/26.
 */
public class UserServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException {
        System.out.println("调用doGet方法");
        response.setContentType("text;html;charset=utf-8");
        String username=request.getParameter("username");
        String password=request.getParameter("password");
        System.out.println("username="+username);
        System.out.println("password="+password);
        System.out.println("servlet test success....");

        UserEntityTest test = new UserEntityTest();
        test.testHibernateUtil();
    }


    protected void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException{
        System.out.println("调用doPost方法");
        doGet(request,response);
    }
}
